package oleg.images;

/**
 * Copyright 2009 Oleg Frenkel
 *
 * This file is part of PerfectSearch.
 *
 * PerfectSearch is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * PerfectSearch is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with PerfectSearch.  If not, see <http://www.gnu.org/licenses/>.
 */

import java.util.*;
import javax.microedition.lcdui.Image;

import oleg.MainForm;
import oleg.locale.LocaleManager;

public class ImageManager
{
  final public static int PHONE_HOME = 1;
  final public static int PHONE_FAX = 2;
  final public static int PHONE_MOBILE = 3;
  final public static int PHONE_OTHER = 4;
  final public static int PHONE_PAGER = 4;
  final public static int PHONE_SMS = 4;
  final public static int PHONE_WORK = 5;
  final public static int PHONE_GENERAL = 4;

  private static Hashtable images = new Hashtable();

  static public Image getImage(int imageId)
  {
    Image image = (Image)images.get("" + imageId);
    if(image == null) {
      image = LocaleManager.instance().getImage(imageId);
      synchronized(images) {
        images.put("" + imageId, image);
      }
    }
    return image;
  }

}
